<?php

namespace frontend\modules\cms\controllers;

use Yii;
use frontend\components\Controller;
use frontend\modules\cms\models\ArticleCommentSearch;
use frontend\modules\cms\models\ArticleRepliesSearch;

/**
 * 资讯评论列表相关接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class CommentController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * @inheritdoc
     */
    public function actionIndex($id) {
        $modelClass = new ArticleCommentSearch();
        $modelClass->article_id = $id;
        return $modelClass->search();
    }

    /**
     * @inheritdoc
     */
    public function actionFloor($id, $commentid) {
        $modelClass = new ArticleRepliesSearch($id);
        return $modelClass->search($commentid);
    }

}
